package io;

import java.io.*;
import java.util.Scanner;

public class PWDemo03 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos = new FileOutputStream("pw03.txt",true);
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw =new PrintWriter(bw,true);
        Scanner sc = new Scanner(System.in);
        String data = sc.nextLine();
        while (!"exit".equals(data)){
            pw.println(data);
            System.out.println("写出完毕");
            data = sc.nextLine();
        }
        pw.close();
    }
}
